<template>
  <div id="app">
    
    <router-view v-if="isRouterAlive"/>
  </div>
</template>

<script>
export default {
  name: "app",
  data() {
    return {
      isRouterAlive: true,
    };
  },
  provide() {
    //提供
    return {
      reload: this.reload,
    };
  },
  methods: {
    noShake(){
       if (this.time == 0) {
        let that=this
        that.time = 20; //设定间隔时间（秒）
        //启动计时器，倒计时time秒后自动关闭计时器。
        let index = setInterval(function(){
            that.time--;
            
            if (that.time == 0) {
                clearInterval(index);
                that.time=''
            }
        }, 1000);
 		//此处可写要执行的代码
        console.log('按钮事件被触发');
    }else{
        console.log('目前按钮事件不允许被触发');
    }
     },
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(function () {
        this.isRouterAlive = true;
      });
    },
  },
};
</script>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

* {
  margin: 0;
  padding: 0;
  user-select: none;
}
img{
  cursor: pointer;
}

body .el-table th.gutter {
  display: table-cell !important;
}
a{
  text-decoration: none;
}
ul,li{
  list-style: none;
}
</style>